
# set jvm params

#JDK所在路径
JAVA_HOME="/opt/jdk"

#bin目录
BIN_DIR=$(pwd)
chmod 0755 *.sh
cd ..
#APP根目录
APP_HOME=$(pwd)

#需要启动的Java主程序（main方法类）
APP_MAINCLASS=com.jeez.auth.AuthServerApplication

#拼凑完整的classpath参数，包括指定lib目录下所有的jar
CLASSPATH=$CLASSPATH:$APP_HOME/classes
for i in "$APP_HOME"/lib/*.jar; do
   CLASSPATH="$CLASSPATH":"$i"
done

export CLASSPATH

export JAVA_OPTS="$JAVA_OPTS -Xms512m"
export JAVA_OPTS="$JAVA_OPTS -Xmx512m"
export JAVA_OPTS="$JAVA_OPTS -Xmn256m"

# The hotspot server JVM has specific code-path optimizations
# which yield an approximate 10% gain over the client version.
export JAVA_OPTS="$JAVA_OPTS -server"

# Basically tell the JVM not to load awt libraries
export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"

# set encoding
export JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=utf-8"

# OOM
export JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"

# set garbage collector
export JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled"

# print gc log
# export JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
# export JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=${LOGS_DIR}"
# export JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails"
# export JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDateStamps"
# export JAVA_OPTS="$JAVA_OPTS -Xloggc:${LOGS_DIR}/dump_head.txt"

# only for jdk 1.7
#export JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize="256m

